public class MotherDemo05 {
    public static void main(String[] args) {
        float sum = 0;
        int i = 0;// 记录天上
        for (; ; ) {
            i++;
            sum += 5;

            if (i % 3 == 0) {//每3天花4.2
                sum -= 4.2;
            }
            if (sum >= 100) {// 钱大于100，停止循环
                break;
            }
        }
        System.out.println(i + "---" + sum);
    }
}
